import Router from 'koa-router'
import permissionController from '@/controller/permission.controller'
import { vertifyAuth } from '@/middleware/auth.middleware'
import { verifyPermission } from '@/middleware/permission.middleware'

const permissionRouter = new Router({ prefix: '/permission' })

permissionRouter.get('/', vertifyAuth, permissionController.get)
permissionRouter.post('/', vertifyAuth, verifyPermission, permissionController.create)
permissionRouter.put('/', vertifyAuth, verifyPermission, permissionController.edit)
permissionRouter.delete('/', vertifyAuth, permissionController.delete)

export default permissionRouter